//
//  WithDrawViewController.m
//  quxiangtao
//
//  Created by xbmios on 2018/7/11.
//  Copyright © 2018年 shanhaijin. All rights reserved.
//

#import "WithDrawViewController.h"
#import "FinancialRecordViewController.h"

@interface WithDrawViewController ()
@property (strong, nonatomic) UIImageView *alipayBg;
@property (strong, nonatomic) UIImageView *arrowBg;
@property (strong, nonatomic) UIImageView *quBg;

@property (strong, nonatomic) UILabel *alipayL;
@property (strong, nonatomic) UILabel *alipayCountL;
@property (strong, nonatomic) UIView *alipayLineIV;

@property (strong, nonatomic) UILabel *phoneL;
@property (strong, nonatomic) UILabel *phoneNumL;
@property (strong, nonatomic) UIView *phoneLineIV;

@property (strong, nonatomic) UILabel *codeL;
@property (strong, nonatomic) UITextField *codeTextField;
@property (strong, nonatomic) UIButton *getCodeBtn;
@property (strong, nonatomic) UIView *codeLineIV;

@property (strong, nonatomic) UILabel *withDrawMoneyL;
@property (strong, nonatomic) UITextField *withDrawMoneyNumL;
@property (strong, nonatomic) UIView *withDrawLineIV;

@property (strong, nonatomic) UILabel *payPasswordL;
@property (strong, nonatomic) UITextField *payPasswordTextField;
@property (strong, nonatomic) UIView *payPasswordLineIV;


@property (strong, nonatomic) UILabel *balanceL;
@property (strong, nonatomic) UILabel *balanceNumL;

@property (strong, nonatomic) UIImageView *withdrawBg;
@property (strong, nonatomic) UILabel *withdrawL;

@end

@implementation WithDrawViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = WhiteColor;
    self.title = @"提现";
    
    [self loadAccount];
    
    self.phoneNumL.text = [CommonUserInfo sharedInstance].phone;
    self.balanceNumL.text = [NSString stringWithFormat:@"%@元 按第三方服务标准收取相应提现手续费", [CommonUserInfo sharedInstance].balance];
    
    UIButton *rigthBtn = [[UIButton alloc] init];
    rigthBtn.frame = CGRectMake(0, 0, jisuan(110), jisuan(50));
    [rigthBtn setTitle:@"提现记录" forState:UIControlStateNormal];
    [rigthBtn setTitle:@"提现记录" forState:UIControlStateSelected];
    [rigthBtn setTitleColor:Color333333 forState:UIControlStateNormal];
    [rigthBtn setTitleColor:Color333333 forState:UIControlStateSelected];
    rigthBtn.titleLabel.font = Font(24);
    [rigthBtn addTarget:self action:@selector(rightBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rigthBtn];
    self.navigationItem.rightBarButtonItem = rightItem;
    
    [self createView];
}

#pragma mark -获取支付宝账号
- (void)loadAccount {
    
    NSString *par = [NSString stringWithFormat:@"{\"user_id\" : \"%@\", }", [RSA encryptString:[CommonUserInfo sharedInstance].user_id publicKey:PublicKey]];
    
    [PPNetworkHelper POST:@"user/Bindingcard/Bindingdetail" parameters:@{@"json" : par} success:^(id responseObject) {
        
        NSLog(@"获取绑定的支付宝信息：%@", responseObject);
        
        if ([responseObject[@"code"] integerValue] == 1) {
            
            NSDictionary *dict = responseObject[@"data"];
            self.alipayCountL.text = dict[@"cardid"];
            
        }else {
            
            [[KYAlertView sharedInstance] showAlertViewWithMessage:responseObject[@"msg"]];
            
        }
        
    } failure:^(NSError *error) {
        
        if (error) {
            
            [[KYAlertView sharedInstance] showAlertViewWithMessage:Tip];
        }
    }];
    
    
    
}

#pragma mark -提现记录
- (void)rightBtnClick:(UIButton *)btn {
    
    NSLog(@"提现记录");
    
    FinancialRecordViewController *vc = [[FinancialRecordViewController alloc] init];
    
    vc.type = 1;
    
    [self.navigationController pushViewController:vc animated:YES];

}

#pragma mark -提交申请点击
- (void)withdrawClick:(UIGestureRecognizer *)btn {
    self.withdrawBg.userInteractionEnabled = NO;
    NSLog(@"提交申请");
    
    if (self.codeTextField.text.length <= 0) {
        
        [[KYAlertView sharedInstance] showAlertViewWithMessage:@"请输入验证码"];
        return ;
    }
    
    if (self.withDrawMoneyNumL.text.length <= 0) {
        
        [[KYAlertView sharedInstance] showAlertViewWithMessage:@"请输入提现金额"];
        return;
    }
    
    if (self.payPasswordTextField.text.length <= 0) {
        
        [[KYAlertView sharedInstance] showAlertViewWithMessage:@"请输入支付密码"];
        return;
    }
    
    NSString *userid = [RSA encryptString:[CommonUserInfo sharedInstance].user_id publicKey:PublicKey];
    NSString *money = [RSA encryptString:self.withDrawMoneyNumL.text publicKey:PublicKey];
    NSString *paytype = [RSA encryptString:@"1" publicKey:PublicKey];
    NSString *paypassword = [RSA encryptString:[self.payPasswordTextField.text md5String] publicKey:PublicKey];
    NSString *user_mobile = [RSA encryptString:self.phoneNumL.text publicKey:PublicKey];
    NSString *code = [RSA encryptString:self.codeTextField.text publicKey:PublicKey];
    
    NSString *str = [NSString stringWithFormat:@"{\"userid\" : \"%@\", \"money\" : \"%@\", \"paytype\" : \"%@\", \"paypassword\" : \"%@\", \"user_mobile\" : \"%@\", \"code\" : \"%@\"}", userid, money, paytype, paypassword, user_mobile, code];
    
    NSLog(@"%@\n%@", [self.payPasswordTextField.text md5String], paypassword);
    WS(weakSelf);
    [PPNetworkHelper POST:@"pay/Withdrawals/index" parameters:@{@"json" : str} success:^(id responseObject) {
        weakSelf.withdrawBg.userInteractionEnabled = YES;
        NSLog(@"提现%@", responseObject);
        
        if ([responseObject[@"code"] integerValue] == 1) {
            [[KYAlertView sharedInstance] showAlertViewWithMessage:responseObject[@"msg"]];
            [self.navigationController popToRootViewControllerAnimated:YES];
        }else {
            [[KYAlertView sharedInstance] showAlertViewWithMessage:responseObject[@"msg"]];
        }
        
    } failure:^(NSError *error) {
        
        if (error) {
            
            [[KYAlertView sharedInstance] showAlertViewWithMessage:Tip];
        }
        
    }];
    
}

#pragma mark -获取验证码
- (void)getCodeClick:(UIButton *)btn {
    
    NSLog(@"获取验证码");
    
    [[CommonAction sharedInstance] getCodeWithPhone:[CommonUserInfo sharedInstance].phone type:@"withdrawals" andSender:btn phoneCodeBlock:^(NSString *codeStr) {
        
    }];
}

- (void)createView {
    
    
    [self.view addSubview:self.alipayBg];
    [self.view addSubview:self.arrowBg];
    [self.view addSubview:self.quBg];
    
    [self.view addSubview:self.alipayL];
    [self.view addSubview:self.alipayCountL];
    [self.view addSubview:self.alipayLineIV];
    
    [self.view addSubview:self.phoneL];
    [self.view addSubview:self.phoneNumL];
    [self.view addSubview:self.phoneLineIV];
    
    [self.view addSubview:self.codeL];
    [self.view addSubview:self.codeTextField];
    [self.view addSubview:self.getCodeBtn];
    [self.view addSubview:self.codeLineIV];
    
    [self.view addSubview:self.withDrawMoneyL];
    [self.view addSubview:self.withDrawMoneyNumL];
    [self.view addSubview:self.withDrawLineIV];
    
    [self.view addSubview:self.payPasswordL];
    [self.view addSubview:self.payPasswordTextField];
    [self.view addSubview:self.payPasswordLineIV];
    
    [self.view addSubview:self.balanceL];
    [self.view addSubview:self.balanceNumL];
    
    [self.view addSubview:self.withdrawBg];
    [self.view addSubview:self.withdrawL];
    
    
    __weak typeof(self) weakSelf = self;
    
    [self.arrowBg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        //        make.left.mas_equalTo(weakSelf.alipayBg.mas_right).with.offset(jisuan(34));
        
        make.centerX.mas_equalTo(weakSelf.view.mas_centerX);
        make.top.mas_equalTo(weakSelf.view.mas_top).with.offset(jisuan(102));
        make.width.mas_equalTo(jisuan(92));
        make.height.mas_equalTo(jisuan(28));
    }];
    [self.alipayBg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.arrowBg.mas_right).with.offset(jisuan(34));
        make.top.mas_equalTo(weakSelf.view.mas_top).with.offset(jisuan(70));
        make.width.mas_equalTo(jisuan(100));
        make.height.mas_equalTo(jisuan(100));
    }];
    [self.quBg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.arrowBg.mas_left).with.offset(-jisuan(34));
        make.top.mas_equalTo(weakSelf.view.mas_top).with.offset(jisuan(70));
        make.width.mas_equalTo(jisuan(100));
        make.height.mas_equalTo(jisuan(100));
    }];
    
    
    [self.alipayL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.alipayBg.mas_bottom).with.offset(jisuan(100));
        make.width.mas_equalTo(jisuan(86));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.alipayCountL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(weakSelf.alipayL.mas_centerY);
        make.left.mas_equalTo(weakSelf.alipayL.mas_right).with.offset(jisuan(64));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        //        make.width.mas_equalTo(jisuan(160));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.alipayLineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.alipayL.mas_bottom).with.offset(jisuan(28));
        make.height.mas_equalTo(jisuan(2));
        
    }];
    
    [self.phoneL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.alipayLineIV.mas_bottom).with.offset(jisuan(26));
        make.width.mas_equalTo(jisuan(86));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.phoneNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(weakSelf.phoneL.mas_centerY);
        make.left.mas_equalTo(weakSelf.phoneL.mas_right).with.offset(jisuan(64));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        //        make.width.mas_equalTo(jisuan(160));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.phoneLineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.phoneL.mas_bottom).with.offset(jisuan(28));
        make.height.mas_equalTo(jisuan(2));
        
    }];
    
    [self.codeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.phoneLineIV.mas_bottom).with.offset(jisuan(26));
        make.width.mas_equalTo(jisuan(86));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.getCodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(64));
        make.centerY.mas_equalTo(weakSelf.codeL.mas_centerY);
        make.width.mas_equalTo(jisuan(130));
        make.height.mas_equalTo(jisuan(34));
    }];
    
    [self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.codeL.mas_right).with.offset(jisuan(64));
        make.centerY.mas_equalTo(weakSelf.codeL.mas_centerY);
        //        make.width.mas_equalTo(jisuan(120));
        make.right.mas_equalTo(weakSelf.getCodeBtn.mas_left).with.offset(-jisuan(40));
        make.height.mas_equalTo(jisuan(34));
    }];
    [self.codeLineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.codeL.mas_bottom).with.offset(jisuan(28));
        make.height.mas_equalTo(jisuan(2));
    }];
    
    [self.withDrawMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.codeLineIV.mas_bottom).with.offset(jisuan(26));
        make.width.mas_equalTo(jisuan(106));
        make.height.mas_equalTo(jisuan(34));
        
    }];
    
    [self.withDrawMoneyNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.withDrawMoneyL.mas_right).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.centerY.mas_equalTo(weakSelf.withDrawMoneyL.mas_centerY);
        make.height.mas_equalTo(jisuan(34));
        
    }];
    
    [self.withDrawLineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.withDrawMoneyL.mas_bottom).with.offset(jisuan(28));
        make.height.mas_equalTo(jisuan(2));
        
    }];
    
    [self.payPasswordL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.withDrawLineIV.mas_bottom).with.offset(jisuan(26));
        make.width.mas_equalTo(jisuan(106));
        make.height.mas_equalTo(jisuan(34));
        
    }];
    
    [self.payPasswordTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.payPasswordL.mas_right).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.centerY.mas_equalTo(weakSelf.payPasswordL.mas_centerY);
        make.height.mas_equalTo(jisuan(34));
        
    }];
    
    [self.payPasswordLineIV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(40));
        make.top.mas_equalTo(weakSelf.payPasswordL.mas_bottom).with.offset(jisuan(28));
        make.height.mas_equalTo(jisuan(2));
        
    }];
    
    [self.balanceL sizeToFit];
    [self.balanceL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.view.mas_left).with.offset(jisuan(40));
        make.top.mas_equalTo(weakSelf.payPasswordLineIV.mas_bottom).with.offset(jisuan(18));
//        make.width.mas_equalTo(jisuan(70));
//        make.height.mas_equalTo(jisuan(28));
    }];
    
    [self.balanceNumL sizeToFit];
    [self.balanceNumL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.balanceL.mas_right).with.offset(jisuan(0));
        make.top.mas_equalTo(weakSelf.payPasswordLineIV.mas_bottom).with.offset(jisuan(18));
//        make.width.mas_equalTo(jisuan());
//        make.right.mas_equalTo(weakSelf.view.mas_right).with.offset(-jisuan(38));
//        make.height.mas_equalTo(jisuan(28));
    }];
    
    [self.withdrawBg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf.view.mas_centerX);
        make.bottom.mas_equalTo(weakSelf.view.mas_bottom).with.offset(-jisuan(66));
        make.width.mas_equalTo(jisuan(550));
        make.height.mas_equalTo(jisuan(106));
        
    }];
    [self.withdrawL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf.withdrawBg.mas_centerX);
        make.centerY.mas_equalTo(weakSelf.withdrawBg.mas_centerY).with.offset(-jisuan(4));
        
        
    }];

    
}

#pragma mark -lazy
- (UIImageView *)alipayBg {
    
    if (!_alipayBg) {
        
        _alipayBg = [[UIImageView alloc] init];
        _alipayBg.contentMode = UIViewContentModeScaleAspectFit;
        _alipayBg.image = [UIImage imageNamed:@"alipayBG"];
    }
    
    return _alipayBg;
}
- (UIImageView *)arrowBg {
    
    if (!_arrowBg) {
        
        _arrowBg = [[UIImageView alloc] init];
        _arrowBg.contentMode = UIViewContentModeScaleAspectFit;
        _arrowBg.image = [UIImage imageNamed:@"withdrawArrowBG"];
    }
    
    return _arrowBg;
}
- (UIImageView *)quBg {
    
    if (!_quBg) {
        
        _quBg = [[UIImageView alloc] init];
        _quBg.contentMode = UIViewContentModeScaleAspectFit;
        _quBg.image = [UIImage imageNamed:@"rechargeLogoBG"];
    }
    
    return _quBg;
}

- (UILabel *)alipayL {
    
    if (!_alipayL) {
        
        _alipayL = [[UILabel alloc] init];
        _alipayL.text = @"支付宝";
        _alipayL.textColor = Color333333;
        _alipayL.font = Font(24);
        _alipayL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _alipayL;
}

- (UILabel *)alipayCountL {
    
    if (!_alipayCountL) {
        
        _alipayCountL = [[UILabel alloc] init];
        _alipayCountL.text = @"15045483071";
        _alipayCountL.textColor = Color333333;
        _alipayCountL.font = Font(24);
        _alipayCountL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _alipayCountL;
}

- (UIView *)alipayLineIV {
    
    if (!_alipayLineIV) {
        
        _alipayLineIV = [[UIView alloc] init];
        _alipayLineIV.backgroundColor = Colordddddd;
    }
    
    return _alipayLineIV;
}

- (UILabel *)payPasswordL {
    
    if (!_payPasswordL) {
        
        _payPasswordL = [[UILabel alloc] init];
        _payPasswordL.text = @"支付密码";
        _payPasswordL.textColor = Color333333;
        _payPasswordL.font = Font(24);
        _payPasswordL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _payPasswordL;
}

- (UITextField *)payPasswordTextField {
    
    if (!_payPasswordTextField) {
        
        _payPasswordTextField = [[UITextField alloc] init];
        _payPasswordTextField.textAlignment = NSTextAlignmentLeft;
        _payPasswordTextField.textColor = Color333333;
        _payPasswordTextField.placeholder = @"请输入支付密码";
        _payPasswordTextField.font = Font(24);
//        _payPasswordTextField.keyboardType = UIKeyboardTypeNumberPad;
        _payPasswordTextField.secureTextEntry = YES;
        
        
    }
    
    return _payPasswordTextField;
}

- (UIView *)payPasswordLineIV {
    
    if (!_payPasswordLineIV) {
        
        _payPasswordLineIV = [[UIView alloc] init];
        _payPasswordLineIV.backgroundColor = Colordddddd;
    }
    
    return _payPasswordLineIV;
}

- (UILabel *)phoneL {
    
    if (!_phoneL) {
        
        _phoneL = [[UILabel alloc] init];
        _phoneL.text = @"手机号";
        _phoneL.textColor = Color333333;
        _phoneL.font = Font(24);
        _phoneL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _phoneL;
}

- (UILabel *)phoneNumL {
    
    if (!_phoneNumL) {
        
        _phoneNumL = [[UILabel alloc] init];
        _phoneNumL.text = @"150****3071";
        _phoneNumL.textColor = Color333333;
        _phoneNumL.font = Font(24);
        _phoneNumL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _phoneNumL;
}

- (UIView *)phoneLineIV {
    
    if (!_phoneLineIV) {
        
        _phoneLineIV = [[UIView alloc] init];
        _phoneLineIV.backgroundColor = Colordddddd;
    }
    
    return _phoneLineIV;
}

- (UILabel *)codeL {
    
    if (!_codeL) {
        
        _codeL = [[UILabel alloc] init];
        _codeL.text = @"验证码";
        _codeL.textColor = Color333333;
        _codeL.font = Font(24);
        _codeL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _codeL;
    
}

- (UITextField *)codeTextField {
    
    if (!_codeTextField) {
        
        _codeTextField = [[UITextField alloc] init];
        _codeTextField.textAlignment = NSTextAlignmentLeft;
        _codeTextField.textColor = Color333333;
        _codeTextField.placeholder = @"请输入验证码";
        _codeTextField.font = Font(24);
        _codeTextField.keyboardType = UIKeyboardTypeNumberPad;
        
    }
    
    return _codeTextField;
}

- (UIButton *)getCodeBtn {
    
    if (!_getCodeBtn) {
        
        _getCodeBtn = [[UIButton alloc] init];
        [_getCodeBtn setTitle:@"获取验证码" forState:UIControlStateNormal];
        
        [_getCodeBtn setTitleColor:Colorff4200 forState:UIControlStateNormal];
        _getCodeBtn.titleLabel.font = Font(24);
        
        [_getCodeBtn addTarget:self action:@selector(getCodeClick:) forControlEvents:UIControlEventTouchUpInside];
        
    }
    
    return _getCodeBtn;
}

- (UIView *)codeLineIV {
    
    if (!_codeLineIV) {
        
        _codeLineIV = [[UIView alloc] init];
        _codeLineIV.backgroundColor = Colordddddd;
    }
    
    return _codeLineIV;
}

- (UILabel *)withDrawMoneyL {
    
    if (!_withDrawMoneyL) {
        
        _withDrawMoneyL = [[UILabel alloc] init];
        _withDrawMoneyL.text = @"提现金额";
        _withDrawMoneyL.textColor = Color333333;
        _withDrawMoneyL.font = Font(24);
        _withDrawMoneyL.textAlignment = NSTextAlignmentLeft;
    }
    
    return _withDrawMoneyL;
}

- (UITextField *)withDrawMoneyNumL {
    
    if (!_withDrawMoneyNumL) {
        
        _withDrawMoneyNumL = [[UITextField alloc] init];
        _withDrawMoneyNumL.textAlignment = NSTextAlignmentLeft;
        _withDrawMoneyNumL.placeholder = @"请输入提现金额";
        _withDrawMoneyNumL.textColor = Color333333;
        _withDrawMoneyNumL.font = Font(24);
        _withDrawMoneyNumL.keyboardType = UIKeyboardTypeDecimalPad;
        
    }
    
    return _withDrawMoneyNumL;
    
}

- (UIView *)withDrawLineIV {
    
    if (!_withDrawLineIV) {
        
        _withDrawLineIV = [[UIView alloc] init];
        _withDrawLineIV.backgroundColor = Colordddddd;
    }
    
    return _withDrawLineIV;
    
}
- (UILabel *)balanceL {
    
    if (!_balanceL) {
        
        _balanceL = [[UILabel alloc] init];
        _balanceL.text = @"可用余额: ";
        _balanceL.textColor = Color9b9b9b;
        _balanceL.font = Font(20);
        _balanceL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _balanceL;
}

- (UILabel *)balanceNumL {
    
    if (!_balanceNumL) {
        
        _balanceNumL = [[UILabel alloc] init];
        _balanceNumL.text = @"1000.00元";
        _balanceNumL.textColor = Color9b9b9b;
        _balanceNumL.font = Font(20);
        _balanceNumL.textAlignment = NSTextAlignmentLeft;
        
    }
    
    return _balanceNumL;
}

- (UIImageView *)withdrawBg {
    
    if (!_withdrawBg) {
        
        _withdrawBg = [[UIImageView alloc] init];
        _withdrawBg.contentMode = UIViewContentModeScaleAspectFit;
        _withdrawBg.image = [UIImage imageNamed:@"redBtnBG"];
        
        _withdrawBg.userInteractionEnabled = YES;
        UITapGestureRecognizer *withdrawGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(withdrawClick:)];
        [_withdrawBg addGestureRecognizer:withdrawGesture];
    }
    
    return _withdrawBg;
}

- (UILabel *)withdrawL {
    
    if (!_withdrawL) {
        
        _withdrawL = [[UILabel alloc] init];
        _withdrawL.textAlignment = NSTextAlignmentCenter;
        _withdrawL.text = @"提交申请";
        _withdrawL.textColor = WhiteColor;
        _withdrawL.font = Font(32);
        
//        _withdrawL.userInteractionEnabled = YES;
//        UITapGestureRecognizer *withdrawGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(withdrawClick:)];
//        [_withdrawL addGestureRecognizer:withdrawGesture];
    }
    
    return _withdrawL;
    
}


#pragma mark -设置
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.hidden = NO;
//    self.tabBarController.tabBar.hidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
    
    [super viewWillDisappear:animated];
    
//    self.navigationController.navigationBar.hidden = NO;
//    self.tabBarController.tabBar.hidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
